home *** CD-ROM | disk | FTP | other *** search
/ Ahoy 1989 February / Ahoy_Magazine_89-02_1989_Double_L.d64 / Pigs & Cows (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  372b  |  16 lines

  1. 1 rem =================================
  2. 2 rem
  3. 3 rem      $80 pigs & $130 cows
  4. 4 rem      (brute force method)
  5. 5 rem
  6. 6 rem        rupert report #62
  7. 7 rem
  8. 9 rem =================================
  9. 10 print "[147]$80 pigs and $130 cows total $1000": print
  10. 20 for p=1 to 1000
  11. 30 for c=1 to 1000
  12. 40 amt = 80*p + 130*c
  13. 50 if amt=1000 then print "solution: ";p; "pigs &"; c; "cows"
  14. 60 next c
  15. 70 next p
  16.